package com.packenius.library.xspdf;

/**
 * Destination that marks a page.
 * @author Christian Packenius, 2013.
 */
class XSPageDestination implements XSDestination {
  /**
   * Number of page to be marked (>= 0).
   */
  final int pageID;

  /**
   * Constructor.
   * @param pageID Page ID, starting with 0.
   */
  XSPageDestination(int pageID) {
    this.pageID = pageID;
  }

  /**
   * @see com.packenius.library.xspdf.XSPdfContent#getPdfContent(com.packenius.library.xspdf.XSPDF)
   */
  public String getPdfContent(XSPDF xsPDF) {
    int pageObjectID = xsPDF.pages.get(pageID).pdfObjectID;
    return "/Dest[" + pageObjectID + " 0 R/XYZ null null 0]>>";
  }
}
